<template>
<el-dialog :visible="isShowDeparture" title="离职申请" @close="handleCancel">
    <el-form
        ref="ruleForm"
        :model="ruleForm"
        status-icon
        label-width="110px"
        :rules="rules"
    >
        <!--离职表单-->
        <el-form-item label="离职时间" prop="exceptTime">
            <el-date-picker
                v-model="ruleForm.exceptTime"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择日期时间"
            />
        </el-form-item>
        <el-form-item label="离职原因" prop="reason">
            <el-input
                v-model="ruleForm.reason"
                type="textarea"
                :autosize="{ minRows: 3, maxRows: 8}"
                style="width: 90%;"
                placeholder="请输入内容"
            />
        </el-form-item>
    </el-form>
    <el-row slot="footer" type="flex" justify="center">
        <el-col :span="6">
            <el-button size="small" type="primary" @click="handleSubmit">确定</el-button>
            <el-button size="small" @click="handleCancel">取消</el-button>
        </el-col>
    </el-row>
</el-dialog>
</template>

<script>
export default {
	props: {
		isShowDeparture: {
			type: Boolean,
			required: true
		}
	},
	data() {
		return {
			ruleForm: {
			    exceptTime: '',
			    reason: '',
			    processKey: 'process_dimission', // 特定的审批
			    processName: '离职'
			},
			rules: {
			    exceptTime: [{ required: true, message: '离职时间不能为空' }],
			    reason: [{ required: true, message: '离职原因不能为空' }]
			}
		}
	},

	methods: {
		/* 取消 */
		handleCancel() {
			this.$emit('update:isShowDeparture', false)
			this.$refs.ruleForm.resetFields()
		},
		/* 确认 */
		handleSubmit() {

		}
	}
}
</script>

<style lang="scss" scoped>
	.el-date-editor{
		width: 90%;
	}
</style>
